// 订单基础信息
const componentBehaviors = require('../../../../behaviors/component');
import { COMPONENT_OPTIONS, TARGET_TYPE } from '../../../../constants/common';
import { COMMON_PAGE } from '../../../../constants/route';
const { navTo } = require('../../../../common/env');

Component({
    behaviors: [componentBehaviors],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        ownerType: {
            type: String,
            value: '',
        },
        ownerLogo: {
            type: String,
            value: '',
        },
        ownerName: {
            type: String,
            value: '',
        },
        ownerId: {
            type: String,
            value: '',
        },
    },
    data: {
        orderTime: '',
    },
    methods: {
        gotoOwnerPage: function () {
            const { ownerType, ownerId } = this.data;
            if (ownerId && ownerType === TARGET_TYPE.brand) {
                navTo(COMMON_PAGE.shareBrand, {
                    brandId: ownerId,
                });
            } else if (ownerId && ownerType === TARGET_TYPE.store) {
                navTo(COMMON_PAGE.shareStore, {
                    storeId: ownerId,
                });
            }
        },
    }
})
